home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / spiderweb / src / postscript / WebMakefile.new < prev   
Encoding:
Text File  |  1993-04-04  |  4.7 KB  |  148 lines

  1. # Copyright 1989 by Norman Ramsey, Odyssey Research Associates
  2. # Not to be sold, but may be used freely for any purpose
  3. # For more information, see file COPYRIGHT in the parent directory
  4. # Modified by Dave Love, Daresbury Lab for local setup and to incorporate
  5. # change files
  6.  
  7. #HOME=/nfs/dlsa/usr10/fx#        # Make no longer inherits environment vars
  8. # (it does inherit env vars on my system!)
  9. THETANGLE=tangle
  10. THEWEAVE=weave
  11. SPIDER=any.spider
  12. WEAVECHANGEFILES=
  13. TANGLECHANGEFILES=
  14. #
  15. DVI=dvi
  16. CFLAGS=-DDEBUG -g -DSTAT
  17.  
  18. # CPUTYPE is a grim hack that attempts to solve the problem of multiple
  19. # cpus sharing a file system.  In my environment I have to have different
  20. # copies of object and executable for vax, sun3, next, iris, and other 
  21. # cpu types.  If you will be using Spidery WEB in a homogenous processor
  22. # environment, you can just set CPUTYPE to a constant, or eliminate it 
  23. # entirely.  
  24. #
  25. # In my environment, the 'cputype' program returns a string that
  26. # describes the current processor.  That means that the easiest thing
  27. # for you to do is to define a 'cputype' program that does something
  28. # sensible.  A shell script that says 'echo "vax"' is fine.
  29.  
  30. CPUTYPE=`cputype`
  31.  
  32. # Change the following three directories to match your installation
  33. #
  34. # the odd placement of # is to prevent any trailing spaces from slipping in
  35.  
  36. WEBROOT=$(HOME)/spiderweb#     # root of the WEB source distribution
  37. DEST=$(HOME)/bin#         # place where the executables go
  38. MACROS=$(HOME)/tex/inputs#     # place where the macros go
  39.  
  40. MASTER=$(WEBROOT)/master#     # master source directory
  41. OBDIR=$(MASTER)/$(CPUTYPE)#    # common object files
  42.  
  43. TANGLESRC=tangle
  44. CTANGLE=ceetangle -I$(MASTER)
  45. CWEAVE=ceeweave -I$(MASTER)
  46. AWKTANGLE=awktangle -I$(MASTER)
  47. COMMONOBJS=$(OBDIR)/common.o $(OBDIR)/pathopen.o
  48. COMMONC=$(MASTER)/common.c $(MASTER)/pathopen.c
  49. COMMONSRC=$(COMMONC) $(MASTER)/spider.awk
  50.  
  51.  
  52.  
  53. # Our purpose is to make tangle and weave
  54.  
  55. web: tangle weave
  56.  
  57. tangle: $(COMMONOBJS) $(TANGLESRC).o
  58.     cc $(CFLAGS) -o $(DEST)/$(THETANGLE) $(COMMONOBJS) $(TANGLESRC).o
  59.  
  60. weave: $(COMMONOBJS) weave.o
  61.     cc $(CFLAGS) -o $(DEST)/$(THEWEAVE) $(COMMONOBJS) weave.o
  62.  
  63.  
  64. source: $(TANGLESRC).c $(COMMONSRC) # make tangle.c and common src, then clean
  65.     if [ -f WebMakefile ]; then exit 1; fi  # don't clean the master!
  66.     if [ -f spiderman.tex ]; then exit 1; fi # don't clean the manual
  67.     -rm -f tangle.web weave.* common.* # remove links that may be obsolete
  68.     -rm -f *.unsorted *.list grammar.web outtoks.web scraps.web 
  69.     -rm -f cycle.test spider.slog
  70.     -rm -f *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
  71.  
  72. # Here is how we make the common stuff
  73.  
  74. $(MASTER)/common.c: $(MASTER)/common.web # no change file
  75.     $(CTANGLE) $(MASTER)/common 
  76.  
  77. $(OBDIR)/common.o: $(MASTER)/common.c
  78.     cc $(CFLAGS) -c $(MASTER)/common.c
  79.     mv common.o $(OBDIR)
  80.  
  81.  
  82. $(MASTER)/pathopen.c: $(MASTER)/pathopen.web # no change file
  83.     $(CTANGLE) $(MASTER)/pathopen 
  84.     mv pathopen.h $(MASTER)
  85.  
  86. $(OBDIR)/pathopen.o: $(MASTER)/pathopen.c
  87.     cc $(CFLAGS) -c $(MASTER)/pathopen.c
  88.     mv pathopen.o $(OBDIR)
  89.  
  90.  
  91. ## Now we make the tangle and weave source locally
  92.  
  93. $(TANGLESRC).c: $(MASTER)/$(TANGLESRC).web $(MASTER)/common.h grammar.web $(TANGLECHANGEFILES)
  94.     -/bin/rm -f $(TANGLESRC).web
  95.     ln $(MASTER)/$(TANGLESRC).web $(TANGLESRC).web
  96. #    chmod -w $(TANGLESRC).web
  97.     $(CTANGLE) $(TANGLESRC) $(TANGLECHANGEFILES)
  98.  
  99. weave.c: $(MASTER)/weave.web $(MASTER)/common.h grammar.web $(WEAVECHANGEFILES)
  100.     -/bin/rm -f weave.web
  101.     ln $(MASTER)/weave.web weave.web
  102. #    chmod -w weave.web
  103.     $(CTANGLE) weave $(WEAVECHANGEFILES)
  104.  
  105. ## Here's where we run SPIDER to create the source
  106.  
  107. grammar.web: $(MASTER)/cycle.awk $(MASTER)/spider.awk $(SPIDER)
  108.     echo "date" `date` | cat - $(SPIDER) | awk -f $(MASTER)/spider.awk
  109.     cat $(MASTER)/transcheck.list trans_keys.unsorted | awk -f $(MASTER)/transcheck.awk
  110.     awk -f $(MASTER)/cycle.awk < cycle.test
  111.     sort *.unsorted | awk -f $(MASTER)/nodups.awk
  112. #    mv *web.tex $(MACROS)
  113.  
  114. ## We might have to make spider first.
  115.  
  116. $(MASTER)/spider.awk: $(MASTER)/spider.web
  117.     $(AWKTANGLE) $(MASTER)/spider
  118.     mv cycle.awk nodups.awk transcheck.awk $(MASTER)
  119.     rm junk.list
  120.  
  121.  
  122. # $(MASTER)/cycle.awk: $(MASTER)/cycle.web # making spider also makes cycle
  123. #     $(AWKTANGLE) $(MASTER)/cycle
  124.  
  125.  
  126. # This cleanup applies to every language
  127.  
  128. clean:
  129.     if [ -f WebMakefile ]; then exit 1; fi # don't clean the master!
  130.     if [ -f spiderman.tex ]; then exit 1; fi # don't clean the manual
  131.     -rm -f tangle.web weave.web common.* # remove links that may be obsolete
  132.     -rm -f *.unsorted *.list grammar.web outtoks.web scraps.web 
  133.     -rm -f cycle.test spider.slog
  134.     -rm -f *.c *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
  135.  
  136.  
  137.  
  138. # booting the new distribution
  139. boot:
  140.     cd ../master; rm -f *.o; for i in $(COMMONC); do \
  141.         cc $(CFLAGS) -c $$i; \
  142.         mv *.o $(OBDIR) ; \
  143.     done; cd ../c
  144.     cc $(CFLAGS) -c $(TANGLESRC).c; \
  145.     cc $(CFLAGS) -o $(DEST)/$(THETANGLE) $(COMMONOBJS) $(TANGLESRC).o
  146.  
  147.  
  148.